<template>
  <div>
    <el-breadcrumb separator="/" class="breadcrumb">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
      <el-breadcrumb-item>活动列表</el-breadcrumb-item>
      <el-breadcrumb-item>活动详情</el-breadcrumb-item>
    </el-breadcrumb>
    <!--  -->
    <el-form ref="form" :model="form" label-width="100px">
      <el-form-item label="基金经理名称">
        <el-input
          placeholder="请输入基金经理名称"
          v-model="form.mname"
        ></el-input>
      </el-form-item>
      <!-- 头像 -->
      <el-form-item label="基金经理头像" class="upload">
        <el-upload
          action="http://dev.woniulab.com:7689/minio/upload/imgs"
          list-type="picture-card"
          :on-success="handlePictureCardPreview"
          :on-remove="handleRemove"
        >
          <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
          <img width="100%" :src="dialogImageUrl" alt="" />
        </el-dialog>
      </el-form-item>
      <el-form-item label="最高学历">
        <el-input
          placeholder="最高学历 例:硕士"
          v-model="form.educationLevel"
        ></el-input>
      </el-form-item>
      <el-form-item label="毕业院校">
        <el-input
          v-model="form.graduateSchool"
          placeholder="毕业院校 例:上海交通大学"
        ></el-input>
      </el-form-item>
      <el-form-item label="专业">
        <el-input
          v-model="form.department"
          placeholder="请输入专业 例:金融系"
        ></el-input>
      </el-form-item>
      <el-form-item label="称呼" class="select">
        <el-select v-model="form.calls" placeholder="经理的称呼">
          <el-option label="先生" value="先生"></el-option>
          <el-option label="女士" value="女士"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="自我介绍">
        <el-input
          type="textarea"
          v-model="form.selfIntroduction"
          placeholder="请输入自我介绍内容"
        ></el-input>
      </el-form-item>
      <el-form-item label="背景经历">
        <el-input
          type="textarea"
          v-model="form.background"
          placeholder="请输入背景经历内容"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers(
  "FundManagerManagement"
);
export default {
  data() {
    return {
      form: {
        mname: "西瓜君", //名字
        graduateSchool: "四川大学", //毕业院校
        educationLevel: "硕士", //最高学历
        department: "中文系", //专业
        selfIntroduction: "懒惰", //自我介绍
        background: "无", //背景经历
        calls: "先生", //性别
        avatar:"",//头像
      },
      dialogImageUrl: "",
      dialogVisible: false,
    };
  },
  methods: {
    ...mapActions(["AddManagerManagements"]),
    onSubmit() {
      this.AddManagerManagements(this.form);
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePictureCardPreview({data}, file, fileList) {
      // this.dialogImageUrl = file.url;
      // this.dialogVisible = true;
      console.log(data, "file");
      this.form.avatar = data
      console.log(this.form,'data数据');
    },
  },
};
</script>

<style scoped>
.breadcrumb {
  margin-bottom: 20px;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.select {
  text-align: left;
}
.upload {
  text-align: left;
}
</style>